package com.senyint.ctrl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import com.senyint.serv.TestServ;

@Component
@Lazy(value=false)
public class TestController {
	private static final Log log = LogFactory.getLog(TestController.class);

	@Resource
	private TestServ serv;
	
//	@Scheduled(cron = "59 59 23 * * *")
	public void print(){
		System.out.println("执行了！！！+"+new Date());
	//	serv.runTask();
		
	}
	
	
    public void runtask(){  
		System.out.println("执行了！！！+"+new Date());
		serv.insertPayAndRefund();//初始化从his载入数据
		
		//设置时间
		Map<String,Object> param = new HashMap<String,Object>();
		param.put("XTSJ",new Date());
		List<Map<String,Object>> list = serv.selectNoPayAndRefund(param);
		for(int i=0;i<list.size();i++){
			Map<String,Object> map = list.get(i);
			serv.updateDisableAndDeleteQueue(map);
		}
//		serv.insertDayEndRecord();//数据装载到日终表里操作
//		serv.updateTask();
    }  
}
